import {lazy} from "react"
import {Navigate} from "react-router-dom"
const Login = lazy(()=>import("../pages/Login"))
const Home = lazy(()=>import("../pages/Index/home"))
const Testpaper = lazy(()=>import("../pages/Index/testpaper"))
const Error = lazy(()=>import("../pages/Index/Errortest"))
const History = lazy(()=>import("../pages/Index/History"))
const Answer = lazy(()=>import('../pages/Anser'))
const Homechiln = [
    {
        path:"/home/testpaper",
        element:<Testpaper></Testpaper>
    },
    {
        path:"/home/error",
        element:<Error></Error>
    },
    {
        path:"/home/history",
        element:<History></History>
    },
]
const routerconfig = [
    {
        path:"/login",
        element:<Login></Login>
    },
    {
        path:"/home",
        element:<Home></Home>,
        children:Homechiln
    },
    {
        path:"/anser",
        element:<Answer></Answer>
    },
    {
        path:"/",
        element:<Navigate to="/login"></Navigate>
    }
]
export default routerconfig